package demo1225.homework;

import java.io.*;

//使用缓冲字符流特有的方法完成一个文件的复制
public class Demo_02 {
    public static void main(String[] args) {
        try (BufferedReader fw = new BufferedReader(new FileReader("大聪明.txt"));
             BufferedWriter fo=new BufferedWriter(new FileWriter("a.txt"))) {
            String s;
            while ((s=fw.readLine())!=null){
                fo.write(s);
                fo.newLine();
            }
            fo.flush();

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
